< previous page page_141 next page >

Page 141
12181-0141a.gif
Figure 5.9.
The Event Builder dialog box enables you
to define the events that the class will use
to interact with the calling application.
12181-0141b.gif
Figure 5.10.
The Class Builder will always list all the properties, methods,
and events for a selected class.
If you look in the Project window, you will now see a new folder and module added to your project. This is the new class that you just created. You still must add a few more things to the class module before you can use it. Even though you defined a method to the class, there is no code in that method's routine to perform. For this class, replace the comment Your code goes here with the following code to the CalcAge subprocedure:
Public Sub CalcAge()
mvarAge = DateDiff (yyyy, mvarBirthdate, Now)
    If mvarAge <= mvarAgeLimit Then
        RaiseEvent UnderAge
    Else
        RaiseEvent OverAge

 
< previous page page_141 next page >

If you like this book, buy it!